package com.todo.biz.application.helper.detection.entity;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author azhebuxing
 * @date 2024/12/13 20:01
 * @description
 */
@Getter
@AllArgsConstructor
public enum TextLabels {
    AD("ad", "广告引流"),
    POLITICAL_CONTENT("political_content", "涉政内容"),
    PROFANITY("profanity", "辱骂内容"),
    CONTRABAND("contraband", "违禁内容"),
    SEXUAL_CONTENT("sexual_content", "色情内容"),
    VIOLENCE("violence", "暴恐内容"),
    NONSENSE("nonsense", "无意义内容"),
    NEGATIVE_CONTENT("negative_content", "不良内容"),
    RELIGION("religion", "宗教内容"),
    CYBERBULLYING("cyberbullying", "网络暴力"),
    AD_COMPLIANCE("ad_compliance", "广告法合规"),
    C_CUSTOMIZED("C_customized", "用户库命中"),

    NONE("none", "无");

    private static Map<String, TextLabels> codeMap = Arrays.stream(TextLabels.values()).collect(Collectors.toMap(TextLabels::getCode, e -> e));


    private String code;

    private String desc;

    public static TextLabels getByCode(String code) {
        if (codeMap.containsKey(code)) {
            return codeMap.get(code);
        }
        return NONE;
    }
}
